package com.own.business.exam.entity.map;


import com.own.business.exam.entity.po.ExamPaper;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * ExamPaperMapVo
 *
 * @author 陈学礼 （你是一段成熟的代码，要学会自己改bug）
 * @version 4.0.0
 * @date 2021/05/18 14:43:47
 * @since 4.0.0
 */
@ApiModel("考试试卷表" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamPaperMapVo extends BaseMap<ExamPaper> {

    @ApiModelProperty("试卷id")
    private Long examId;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("规则id")
    private Long ruleId;

    @ApiModelProperty("练习id")
    private Long practiceId;

    @ApiModelProperty("题目数量")
    private Integer questionNumber;

    @ApiModelProperty("作答状态 0=未作答 1=已作答 2=保存 3=废弃")
    private Integer status;

    @ApiModelProperty("用时（ms）")
    private Long useTime;

    @ApiModelProperty("分数")
    private BigDecimal score;

    @ApiModelProperty("提交练习的时间")
    private LocalDateTime submitTime;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public ExamPaperMapVo(@NonNull ExamPaper entity) {
        super(entity);
        this.examId = entity.getFkExamId();
        this.userId = entity.getFkUserId();
        this.ruleId = entity.getFkRuleId();
        this.practiceId = entity.getFkPracticeId();
        this.questionNumber = entity.getQuestionNumber();
        this.status = entity.getStatus();
        this.useTime = entity.getUseTime();
        this.score = entity.getScore();
        this.submitTime = entity.getSubmitTime();
    }
}
